package headfirst.combined.djview;

public class RPMAdapter implements BeatModelInterface {
	RPMModelInterface rpmModel;
	 
	public RPMAdapter(RPMModelInterface rpm) {
		this.rpmModel = rpm;
	}

	public void initialize() {
		rpmModel.initialize();
	}
	  
    public void on() {
    	rpmModel.on();
    }
  
    public void off() {
    	rpmModel.off();
    }
   
	public int getBPM() {
		return rpmModel.getRPM();
	}
  
    public void setBPM(int bpm) {
    	if(bpm==1){
    		rpmModel.acelerar();
    	}
    	else if(bpm==0){
    		rpmModel.desacelerar();
    	}
    	else{}
    }
   
	public void registerObserver(BeatObserver o) {
		rpmModel.registerObserver(o);
	}
    
	public void removeObserver(BeatObserver o) {
		rpmModel.removeObserver(o);
	}
     
	public void registerObserver(BPMObserver o) {
		rpmModel.registerObserver(o);
	}
  
	public void removeObserver(BPMObserver o) {
		rpmModel.removeObserver(o);
	}
}
